﻿<%@ Page Language="C#" MasterPageFile="~/MasterPages/management.Master" AutoEventWireup="true" CodeBehind="development.aspx.cs" Inherits="pcsse.management.development" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="hoder_sidebar" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="hoder_maincontent" runat="server">
<div class="p_title">
党员发展
</div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
    
    <asp:DetailsView ID="filterDv" runat="server" AutoGenerateRows="False" 
                DataKeyNames="ID" DataSourceID="pGvOds" DefaultMode="Insert" Height="50px" 
                Width="300px">
        <Fields>
            <asp:TemplateField HeaderText="编号" SortExpression="NUMBER">
                <EditItemTemplate>
                    <asp:TextBox ID="numberTb" runat="server" Height="20px" 
                                Text='<%# Bind("NUMBER") %>' Width="100px"></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="numberTb" runat="server" Height="20px" 
                                Text='<%# Bind("NUMBER") %>' Width="100px"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("NUMBER") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="姓名" SortExpression="NAME">
                <EditItemTemplate>
                    <asp:TextBox ID="nameTb" runat="server" Height="20px" 
                                Text='<%# Bind("NAME") %>' Width="100px"></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="nameTb" runat="server" Height="20px" 
                                Text='<%# Bind("NAME") %>' Width="100px"></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("NAME") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="支部" SortExpression="FULLNAME">
                <EditItemTemplate>
                    <asp:DropDownList ID="bfilterDdl" runat="server" DataSourceID="branchOds" 
                                DataTextField="FULLNAME" DataValueField="ID" Height="20px" Width="150px">
                        <asp:ListItem>全部</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="bfilterDdl" runat="server" AppendDataBoundItems="True" 
                                DataSourceID="branchOds" DataTextField="FULLNAME" DataValueField="FULLNAME" 
                                Height="20px" Width="150px">
                        <asp:ListItem>全部</asp:ListItem>
                    </asp:DropDownList>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("FULLNAME") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="状态" SortExpression="STATE_TEXT">
                <EditItemTemplate>
                    <asp:DropDownList ID="sfilterDdl" runat="server" DataSourceID="stateOds" 
                                DataTextField="STATE_TEXT" DataValueField="STATE_ID" Height="20px" 
                                Width="100px">
                        <asp:ListItem Selected="True">全部</asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:DropDownList ID="sfilterDdl" runat="server" AppendDataBoundItems="True" 
                                DataSourceID="stateOds" DataTextField="STATE_TEXT" DataValueField="STATE_TEXT" 
                                Height="20px" Width="100px">
                        <asp:ListItem Selected="True">全部</asp:ListItem>
                    </asp:DropDownList>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("STATE_TEXT") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <EditItemTemplate>
                            &nbsp;<asp:LinkButton ID="filterBt" runat="server" CausesValidation="false" 
                                CommandName="" onclick="filterBt_Click" Text="查找"></asp:LinkButton>
                </EditItemTemplate>
                <InsertItemTemplate>
                            &nbsp;<asp:LinkButton ID="filterBt0" runat="server" CausesValidation="false" 
                                CommandName="" onclick="filterBt_Click" Text="查找"></asp:LinkButton>
                </InsertItemTemplate>
                <ItemTemplate>
                            &nbsp;
                        </ItemTemplate>
            </asp:TemplateField>
        </Fields>
        <FieldHeaderStyle Width="60px" />
    </asp:DetailsView>
            <asp:GridView ID="pGv" runat="server" AutoGenerateColumns="False" 
                DataKeyNames="ID" DataSourceID="pGvOds" AllowSorting="True" 
    onrowupdated="pGv_RowUpdated" AllowPaging="True">
                <Columns>
                    <asp:CommandField SelectText="查看/编辑" ShowEditButton="True" />
                    <asp:BoundField DataField="NUMBER" HeaderText="编号" SortExpression="NUMBER" 
                        ReadOnly="True">
                        <HeaderStyle Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="NAME" HeaderText="姓名" SortExpression="NAME" 
                        ReadOnly="True">
                        <HeaderStyle Width="100px" />
                    </asp:BoundField>
                    <asp:BoundField DataField="FULLNAME" HeaderText="支部名称" ReadOnly="True" 
                        SortExpression="FULLNAME">
                        <HeaderStyle Width="150px" />
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="状态" SortExpression="STATE_TEXT">
                        <EditItemTemplate>
                            <asp:DropDownList ID="stateDdl" runat="server" DataSourceID="stateOds" 
                                DataTextField="STATE_TEXT" DataValueField="STATE_ID" Height="20px" 
                                SelectedValue='<%# Bind("STATE_ID") %>' Width="80px">
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("STATE_TEXT") %>'></asp:Label>
                        </ItemTemplate>
                        <HeaderStyle Width="100px" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="下次提醒时间" SortExpression="REMIND_TIME">
                        <EditItemTemplate>
                            <asp:TextBox ID="rtimeTb" runat="server" Height="20px" onfocus="calendar()" 
                                Text='<%# Bind("REMIND_TIME", "{0:d}") %>' Width="150px"></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" 
                                Text='<%# Bind("REMIND_TIME", "{0:d}") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle Width="150px" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:ObjectDataSource ID="pGvOds" runat="server" 
                OldValuesParameterFormatString="original_{0}" SelectMethod="GetDataByBP" 
                TypeName="personTableAdapters.T_PERSONINFOTableAdapter" 
        UpdateMethod="UpdateState">
                <UpdateParameters>
                    <asp:Parameter Name="STATE_ID" Type="Int32" />
                    <asp:Parameter Name="REMIND_TIME" Type="DateTime" />
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:SessionParameter Name="BRANCH_ID" 
                        SessionField="Branch" Type="Int32" />
                    <asp:SessionParameter DefaultValue="2" Name="PRIORITY_ID" 
                        SessionField="Priority" Type="String" />
                </SelectParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="branchOds" runat="server" DeleteMethod="Delete" 
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetDataByID" TypeName="managementTableAdapters.T_BRANCHTableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="YEAR" Type="String" />
                    <asp:Parameter Name="BR_NAME" Type="String" />
                    <asp:Parameter Name="Original_ID" Type="Int32" />
                </UpdateParameters>
                <SelectParameters>
                    <asp:SessionParameter Name="PRIORITY_ID" SessionField="Priority" Type="String" 
                        DefaultValue="2" />
                    <asp:SessionParameter Name="Original_ID" SessionField="Branch" Type="Int32" />
                </SelectParameters>
                <InsertParameters>
                    <asp:Parameter Name="YEAR" Type="String" />
                    <asp:Parameter Name="BR_NAME" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:ObjectDataSource ID="stateOds" runat="server" DeleteMethod="Delete" 
                InsertMethod="Insert" OldValuesParameterFormatString="original_{0}" 
                SelectMethod="GetData" TypeName="managementTableAdapters.T_STATETableAdapter" 
                UpdateMethod="Update">
                <DeleteParameters>
                    <asp:Parameter Name="Original_STATE_ID" Type="Int32" />
                </DeleteParameters>
                <UpdateParameters>
                    <asp:Parameter Name="STATE_TEXT" Type="String" />
                    <asp:Parameter Name="Original_STATE_ID" Type="Int32" />
                </UpdateParameters>
                <InsertParameters>
                    <asp:Parameter Name="STATE_TEXT" Type="String" />
                </InsertParameters>
            </asp:ObjectDataSource>
            <asp:Label ID="errLb" runat="server"></asp:Label>
            </ContentTemplate>
    </asp:UpdatePanel>
    
            </asp:Content>
